def count_sort(li, max_count=10):
    """计数排序"""
    count = [0 for _ in range(max_count + 1)]
    print(count)
    for val in li:
        count[val] += 1
    li.clear()
    for ind, val in enumerate(count):
        for i in range(val):
            li.append(ind)
    return li


li = [1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
print(li)
li = count_sort(li)
print(li)
